home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 1999 Spring / macformat-077.iso / Shareware Plus / Development / SpriteWorld 2.2 Extra Demos / User Contributions / ButtonBreakOut ƒ / DataPersistence / DataPersistence.h < prev    next >
Encoding:
Text File  |  1999-01-11  |  2.4 KB  |  84 lines  |  [TEXT/CWIE]

  1. // DataPersistence.h
  2.  
  3. #ifndef __DATAPERSISTENCE_
  4. #define __DATAPERSISTENCE_
  5.  
  6. #ifdef     OWNER
  7. #define    SCOPE
  8. #define    INIT(x)            =x
  9. #else
  10. #define    SCOPE            extern
  11. #define    INIT(x)
  12. #endif
  13.  
  14.  
  15. ///©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©
  16. //                                            PUBLIC
  17. ///©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©
  18.  
  19. ///≈≈≈≈≈≈≈≈≈≈≈≈    Public data ≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈
  20.  
  21.                 // Customizable
  22.  
  23. #define            kDefaultPersistenceRezType    'PERS'    // change if you like
  24.  
  25. #define            kNoNewType                    '????'    // special value, don't change
  26.                                                     // to see why, => SWGOpenPersistenceFileConditionally()
  27.  
  28. SCOPE Str63        gPersistenceFileName        INIT("\pData Persistence");    // change if you like
  29.  
  30.                 // Not intended for customization
  31.  
  32. #define            kDataSizeBiggerError            -6000
  33. #define            kDataSizeSmallerError            -6001
  34.  
  35. ///≈≈≈≈≈≈≈≈≈≈≈≈    Public prototypes ≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈
  36.  
  37.                 // Customizable
  38.  
  39. void            SWGErrorReportingStub (OSErr err);
  40.  
  41.                 // Not intended for customization (but you never know :)
  42.  
  43. OSErr            SWGOpenPersistenceFile (void);
  44. void            SWGClosePersistenceFile (void);
  45. Boolean            SWGOpenPersistenceFileConditionally (OSType newType);
  46.  
  47. OSErr            SWGSaveRecord (Ptr recordP, Size recSize, SInt16 resourceID);
  48. #define            SWGSaveString    SWGSaveRecord    // for symmetry with SWGLoadString
  49.  
  50. OSErr            SWGLoadRecord (Ptr recordP, Size recSize, SInt16 resourceID);
  51. OSErr            SWGLoadString (Ptr stringP, Size maxStringSize, SInt16 resourceID);
  52.  
  53.  
  54. ///©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©
  55. //                                            PRIVATE
  56. ///©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©
  57.  
  58. #ifdef OWNER
  59.  
  60. ///≈≈≈≈≈≈≈≈≈≈≈≈    Private data ≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈
  61.  
  62. OSType            gSWGPersistenceResourceType                = kDefaultPersistenceRezType;
  63.  
  64. Boolean            gSWGPersistenceFileIsOpen                = false;
  65. Boolean            gSWGPersistenceUsesAppFork                = false;
  66. SInt16            gSWGPreviousResFile                        = -1;
  67. SInt16            gSWGPersistenceResFile                    = -1;
  68.  
  69.  
  70. ///≈≈≈≈≈≈≈≈≈≈≈≈    Private prototypes ≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈
  71.  
  72. void            _SWGOverrideResourceType (OSType newType);
  73. void            _SWGRestoreResourceType (void);
  74.  
  75.  
  76. #endif             // OWNER
  77.  
  78. #undef            SCOPE
  79. #undef            INIT
  80.  
  81. #endif             // __DATAPERSISTENCE_
  82.  
  83. // end
  84.